Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented IPAM Range #48

Open
wants to merge 9 commits into
base: v2
Choose a base branch
from

Conversation

JchhatbarInfoblox
Copy link
Collaborator

Implemented IPAM Range

@JchhatbarInfoblox JchhatbarInfoblox marked this pull request as ready for review December 3, 2024 08:06
changelogs/fragments/38-range.yml Outdated Show resolved Hide resolved
meta/runtime.yml Outdated Show resolved Hide resolved
plugins/modules/ipam_range.py Outdated Show resolved Hide resolved
plugins/modules/b1_ipam_range.py Outdated Show resolved Hide resolved
tests/integration/targets/ipam_range/tasks/main.yml Outdated Show resolved Hide resolved
state: "absent"
ignore_errors: true

- name: "Delete IP Space"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a standardized cleanup file in setup_ip_space instead of this and call that from here ?
Something like :

- ansible.builtin.include_role:
    name: "setup_ip_space"
    tasks_from: "cleanup.yml"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isnt resolved yet.

plugins/modules/ipam_range.py Outdated Show resolved Hide resolved
plugins/modules/ipam_range.py Outdated Show resolved Hide resolved
plugins/modules/ipam_range.py Outdated Show resolved Hide resolved
plugins/modules/ipam_range.py Outdated Show resolved Hide resolved
plugins/modules/ipam_range.py Outdated Show resolved Hide resolved
"""

EXAMPLES = r"""
- name: Retrieve range information by ID
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Retrieve range information by ID
- name: Get Range information by ID

ipam_range_info:
id: "range-id-12345"

- name: Retrieve range information with filters
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Retrieve range information with filters
- name: Get Range information with filters (eg. start , end)

start: "192.168.1.0"
end: "192.168.1.255"

- name: Retrieve range information with filter query
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Retrieve range information with filter query
- name: Get Range information with filter query

- name: Retrieve range information with filter query
ipam_range_info:
filter_query: "start=='10.0.0.1' and end=='10.0.0.100'"
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an examples of filtering using Tag Filters ?

type: dict
returned: Always
contains:
abandoned:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update descriptions please !

- infoblox.bloxone.common
"""
EXAMPLES = r"""
- name: "Create an Ip Space"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: "Create an Ip Space"
- name: "Create an IP Space"

space: "{{ ip_space.id }}"
state: "present"

- name: "Create a Range"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woudnt it be a better idea to split the create example into 2 parts , one consisting of only the necessart fields and one with additional fields , something like done with IPAM Host .
https://github.com/VishrutiBuddhadev/bloxone-ansible/blob/4af66b30adfd2c564838c69822984dc2bbaf48ec/plugins/modules/ipam_host.py#L112

id: "range-id-12345"

- name: Retrieve range information with filters
ipam_range_info:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ipam_range_info:
infoblox.bloxone.ipam_range_info:

@@ -0,0 +1,297 @@
---
# TODO: Add tests for DHCP Options the ipam_range module
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is DHCP Options added to TODO ?

tags:
location: "{{ tag_value }}"
state: "present"
register: ip_range
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be either "ipam_range" or "range"

api_key: "{{ api_key }}"

block:
- name: "Delete IP Space"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: "Delete IP Space"
- name: "Delete Subnet"


block:
- name: "Delete IP Space"
infoblox.bloxone.ipam_ip_space:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
infoblox.bloxone.ipam_ip_space:
infoblox.bloxone.ipam_subnet:

block:
- name: "Delete IP Space"
infoblox.bloxone.ipam_ip_space:
name: "{{ name }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: "{{ name }}"
address: "10.0.0.0/24"
space: "{{ _ip_space.id }}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants